import request from '@/utils/request';

// 获取菜单详情
export function getMenuDetailApi(objectId) {
  let url = process.env.VUE_APP_SYS_SERVICE + 'api/sysMenu/getById';
  return request({
    url: url,
    method: 'get',
    params: { objectId }
  });
}

// 创建或者编辑菜单
export function createOrEditMenuApi(postBody) {
  let url = process.env.VUE_APP_SYS_SERVICE + 'api/sysMenu/create';
  if (postBody.objectId) {
    url = process.env.VUE_APP_SYS_SERVICE + 'api/sysMenu/update';
  }
  return request({
    url: url,
    method: 'post',
    data: postBody
  });
}